<template>
  <div>
    <el-dialog
      :title="
        activeName == 'first'
          ? '【详情-基本信息】'
          : activeName == 'second'
          ? '【详情-股东信息】'
          : activeName == 'third'
          ? '【详情-变更记录】'
          : ''
      "
      :visible.sync="centerDialogVisible"
      width="80%"
      @close="cancel"
      center
    >
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="基本信息" name="first"
          ><div v-if="activeName == 'first' && centerDialogVisible">
            <patternDatacampany
              :initObj="initObj"
              :pinyin="pinyin"
            ></patternDatacampany>
          </div>
        </el-tab-pane>
        <el-tab-pane label="股东信息" name="second"
          ><div v-if="activeName == 'second' && centerDialogVisible">
            <tableDatacampany
              :initObj="initObj"
              :pinyin="pinyin"
            ></tableDatacampany>
          </div>
        </el-tab-pane>
        <el-tab-pane label="变更记录" name="third">
          <div v-if="activeName == 'third' && centerDialogVisible">
            <tableDatacam
              :initObj="initObj"
              :pinyin="pinyin"
            ></tableDatacam></div
        ></el-tab-pane>
      </el-tabs>
    </el-dialog>
  </div>
</template>

<script>
import patternDatacampany from "./patternDatacampany.vue";
import tableDatacampany from "./tableDatacampany.vue";
import tableDatacam from "./tableDatacam.vue";
import {
  getBillDetail,
  getCommissionRecordList,
  getCommissionRecordDetail,
} from "@/api/commission";

export default {
  components: {
    tableDatacampany,
    patternDatacampany,
    tableDatacam,
  },
  data() {
    return {
      activeName: "first",
      centerDialogVisible: false,
      info: {},
      initObj: {},
      pinyin: "",
    };
  },
  created() {
    // this.getInfo();
  },
  mounted() {},
  methods: {
    // getInfo() {
    //   console.log(11111111111111);

    //   var obj = {
    //     creditCode: this.initObj.creditCode,
    //     pinyin: this.initObj.pinyin,
    //   };
    //   console.log(obj);

    //   EetTycEnterpriseInfo(obj)
    //     .then((res) => {
    //       this.info = res.data;
    //     })
    //     .finally(() => {});
    // },
    handleClick(tab, event) {
      console.log(tab, event);
    },
    async openDialog(row, pinyin) {
      this.pinyin = pinyin;
      console.log(row);

      this.initObj = row;
      this.centerDialogVisible = true;
    },

    cancel() {
      this.centerDialogVisible = false;
      this.$emit("cancel", false);
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .el-dialog__title {
  color: #222222;
  font-size: 16px;
  font-weight: 500;
}
.title {
  font-weight: 500;
  font-size: 18px;
  color: #222222;
  margin-bottom: 20px;
}
.left {
  width: 50%;
  margin-right: 30px;
  .labelItem {
    text-align: center;
    padding: 15px 0;
    background: #f5f5f5;
    color: #222222;
    span {
      color: #999999;
    }
  }
  .label {
    text-align: center;
    padding: 15px 0;
    color: #222222;
    span {
      color: #999999;
    }
  }
}
.right {
  width: 50%;
  .labelItem {
    text-align: center;
    padding: 15px 0;
    background: #f5f5f5;
    color: #222222;
    span {
      color: #999999;
    }
  }
  .label {
    text-align: center;
    padding: 15px 0;
    color: #222222;
    span {
      color: #999999;
    }
  }
}

.detail {
  /deep/ .el-dialog__body {
    padding-left: 90px;
  }
  /deep/ .el-form-item__label {
    color: #222222;
    font-weight: 400;
    font-size: 16px;
  }
  /deep/ .el-form-item__content {
    color: #222222;
    font-size: 16px;
  }
}
</style>
